$OpenBSD: patch-driver_passwd-pwent_c,v 1.3 2016/05/12 11:36:48 sthen Exp $
--- driver/passwd-pwent.c.orig	Sat Dec 27 11:17:26 2008
+++ driver/passwd-pwent.c	Wed May 11 23:43:04 2016
@@ -133,7 +133,7 @@ user_name (void)
      still work.  Right?) */
   if (!u || !*u)
     {
-      struct passwd *p = getpwuid (getuid ());
+      struct passwd *p = getpwuid_shadow (getuid ());
       u = (p ? p->pw_name : 0);
     }
 
@@ -177,7 +177,7 @@ get_encrypted_passwd(const char *user)
 
   if (user && *user && !result)
     {					/* Check non-shadow passwords too. */
-      struct passwd *p = getpwnam(user);
+      struct passwd *p = getpwnam_shadow(user);
       if (p && passwd_known_p (p->pw_passwd))
 	result = strdup(p->pw_passwd);
     }
